﻿using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;
using DomainComponents.Common;
using System.Drawing;
using DevExpress.Xpo.Metadata;

namespace DomainComponents.XCRM {
    [DomainComponent]
    [ImageName("BO_Contact")]
    [XafDefaultProperty("FullName")]
    [VisibleInReports]
    [XafDisplayName("Contact")]
    public interface IContact : IPerson, ICustomer {
        IAccount Account { get; set; }
        [Size(SizeAttribute.Unlimited), Delayed(true), ValueConverter(typeof(ImageValueConverter))]
        Image Photo { get; set; }
    }

    [DomainLogic(typeof(IContact))]
    public class ContactLogic {
        public static string Get_Name(IContact contact) {
            return contact.FullName;
        }
    }
}
